In which direction is the turtle pointed by default?
1.North
2.South
3.East
4.West
Posted Date:-2022-01-02 09:43:41
The function random.randint(4) can return only one of the following values. Which?
1. 4
2. 3.4
3. error
4.5
Posted Date:-2022-01-02 08:48:40
What does print(os.geteuid()) print?
1.the group id of the current process
2. the user id of the current process
3.both the group id and the user of the current process
4.none of the mentioned
Posted Date:-2022-01-02 09:31:00
What will be the output of the following Python code? import sys eval(sys.stdin.readline()) Computer
1.Error
2.‘Computer ’
3. Computer8
4.Computer
Posted Date:-2022-01-02 09:27:29
What will be the output of the following Python code? import sys sys.stderr.write(“helloâ€)
1.‘hello’
2. ‘hello ’
3.hello
4.hello5
Posted Date:-2022-01-02 09:28:53
What will be the output of the following Python code? import sys sys.stdin.readline() Sanfoundry
1.‘Sanfoundry ’
2.‘Sanfoundry’
3. ‘Sanfoundry10’
4. Error
Posted Date:-2022-01-02 09:25:41
Fill in the blank such that the following Python code results in the formation of an inverted, equilateral triangle. import turtle t=turtle.Pen() for i in range(0,3): t.forward(150) t.right(_____)
1. -60
2.120
3.-120
4.60
Posted Date:-2022-01-02 09:37:09
hat will be the output of the following Python code? import turtle t=turtle.Pen() t.color(1,1,1) t.begin_fill() for i in range(0,3): t.forward(100) t.right(120) t.end_fill()
1.Blank page
2.A triangle filled in with the colour yellow
3.A triangle which is not filled in with any colour
4.error
Posted Date:-2022-01-02 09:42:25
The command used to set only the x coordinate of the turtle at 45 units is:
1. reset(45)
2.setx(45)
3.xset(45)
4.xreset(45)
Posted Date:-2022-01-02 09:53:18
The command which helps us to reset the pen (turtle):
1.turtle.reset
2. turtle.penreset
3.turtle.penreset()
4. turtle.reset()
Posted Date:-2022-01-02 09:36:41
The number of lines drawn in each case, assuming that the turtle module has been imported: Case 1: for i in range(0,10): turtle.forward(100) turtle.left(90) Case 2: for i in range(1,10): turtle.forward(100) turtle.left(90)
1.10, 9
2.9, 10
3.9, 9
4. 10, 10
Posted Date:-2022-01-02 09:36:11
The output of the function len(sys.argv) is _____
1.Error
2.1
3.0
4. Junk value
Posted Date:-2022-01-02 09:29:57
To obtain a list of all the functions defined under sys module, which of the following functions can be used?
1.print(sys)
2.print(dir.sys)
3.print(dir[sys])
4.print(dir(sys))
Posted Date:-2022-01-02 09:29:33
What does os.close(f) do?
1. terminate the process f
2. terminate the process f if f is not responding
3.close the file descriptor f
4.return an integer telling how close the file pointer is to the end of file
Posted Date:-2022-01-02 09:31:51
What does os.fchmod(fd, mode) do?
1.change permission bits of the file
2.change permission bits of the directory
3. change permission bits of either the file or the directory
4.none of the mentioned
Posted Date:-2022-01-02 09:32:16
What does os.getlogin() return?
1.name of the current user logged in
2.name of the superuser
3. gets a form to login as a different user
4.all of the mentioned
Posted Date:-2022-01-02 09:31:22
What does os.link() do?
1.create a symbolic link
2.create a hard link
3.create a soft link
4.none of the mentioned
Posted Date:-2022-01-02 09:33:29
What does os.name contain?
1. the name of the operating system dependent module imported
2.the address of the module os
3.error, it should’ve been os.name()
4. None of the mentioned
Posted Date:-2022-01-02 09:30:36
What does random.shuffle(x) do when x = [1, 2, 3]?
1. error
2.do nothing, it is a placeholder for a function that is yet to be implemented
3.shuffle the elements of the list in-place
4.none of the mentioned
Posted Date:-2022-01-02 08:50:51
What is the range of values that random.random() can return?
1.[0.0, 1.0]
2. (0.0, 1.0]
3.(0.0, 1.0)
4.[0.0, 1.0)
Posted Date:-2022-01-02 08:52:01
What the does random.seed(3) return?
1. True
2.None
3.3
4. 1
Posted Date:-2022-01-02 08:45:48
What will be the output of the following Python code, if the code is run on Windows operating system? import sys if sys.platform[:2]== 'wi': print("Hello")
1.Error
2. Hello
3.No output
4. Junk value
Posted Date:-2022-01-02 08:53:24
What will be the output of the following Python code, if the sys module has already been imported? sys.stdout.write("hello world")
1.helloworld
2. hello world10
3. hello world11
4.error
Posted Date:-2022-01-02 09:24:25
What will be the output of the following Python code? import sys eval(sys.stdin.readline()) "India"
1. India5
2.India
3. ‘India ’
4.‘India’
Posted Date:-2022-01-02 09:26:38
What will be the output of the following Python code? import sys sys.argv[0]
1.Junk value
2.‘ ‘
3.No output
4.error
Posted Date:-2022-01-02 09:27:57
What will be the output of the following Python code? import turtle t=turtle.Pen() for i in range(0,4): t.forward(100) t.left(90) t.penup() t.left(90) t.forward(200) for i in range(0,4): t.forward(100) t.left(90)
1. Error
2. 1 square
3. 2 squares, at a separation of100 units, joined by a straight line
4.2 squares, at a separation of 100 units, without a line joining them
Posted Date:-2022-01-02 09:38:10
What will be the output of the following Python code? import turtle t=turtle.Pen() for i in range(0,5): t.left(144) t.forward(100)
1.Trapezium
2.Parallelepiped
3.Tetrahedron
4.Star
Posted Date:-2022-01-02 09:39:25
What will be the output of the following Python code? import turtle t=turtle.Pen() t.clear() t.isvisible()
1.Yes
2.True
3.No
4.False
Posted Date:-2022-01-02 09:54:35
What will be the output of the following Python code? import turtle t=turtle.Pen() t.color(0,0,1) t.begin_fill() t.circle(15) t.end_fill()
1.Error
2.A circle filled in with the colour red
3.A circle filled in with the colour blue
4. A circle filled in with the colour green
Posted Date:-2022-01-02 09:40:36
What will be the output of the following Python code? import turtle t=turtle.Pen() t.color(0,1,0) t.begin_fill() for i in range(0,4): t.forward(100) t.right(90)
1. A square filled in with the colour green
2.A square outlined with the colour green
3. Blank canvas
4.error
Posted Date:-2022-01-02 09:43:16
What will be the output of the following Python code? import turtle t=turtle.Pen() t.forward(100) t.left(90) t.clear() t.position()
1.0.00, 90.00
2.0.00, 0.00
3.100.00, 90.00
4.100.00, 100.00
Posted Date:-2022-01-02 09:55:03
What will be the output of the following Python code? import turtle t=turtle.Pen() t.goto(300,9) t.position()
1.300.00, 9.00
2. 9, 300
3. 300, 9
4.9.00, 300.00
Posted Date:-2022-01-02 09:38:59
What will be the output of the following Python code? import turtle t=turtle.Pen() t.right(90) t.forward(100) t.heading()
1. 0.0
2.90.0
3.270.0
4.360.0
Posted Date:-2022-01-02 09:54:11
What will be the output of the following Python functions? import turtle t=turtle.Pen() for i in range(0,3): t.forward(100) t.left(120) t.back(100) for i in range(0,3): t.forward(100) t.left(120)
1.Error
2.Two triangles, joined by a straight line
3.Two triangles, joined at one vertex
4.Two separate triangles, not connected by a line
Posted Date:-2022-01-02 09:39:49
What will be the output shape of the following Python code? import turtle t=turtle.Pen() for i in range(0,4): t.forward(100) t.left(120)
1.square
2.rectangle
3.triangle
4.kite
Posted Date:-2022-01-02 09:35:08
What will be the output shape of the following Python code? import turtle t=turtle.Pen() for i in range(1,4): t.forward(60) t.left(90)
1. Rectangle
2.Trapezium
3.Triangle
4. Square
Posted Date:-2022-01-02 09:37:36
Which of the following can be used to create a directory?
1.os.mkdir()
2.os.creat_dir()
3.os.create_dir()
4.os.make_dir()
Posted Date:-2022-01-02 09:33:55
Which of the following can be used to create a symbolic link?
1. os.symlink()
2.os.symb_link()
3.os.symblin()
4. os.ln()
Posted Date:-2022-01-02 09:34:20
Which of the following cannot be returned by random.randrange(4)?
1.0
2.3
3.2.3
4.none of the mentioned
Posted Date:-2022-01-02 08:47:07
Which of the following functions can be used to make the arrow black?
1.turtle.color(0,1,0)
2.turtle.color(1,0,0)
3.turtle.color(0,0,1)
4. turtle.color(0,0,0)
Posted Date:-2022-01-02 09:41:49
Which of the following functions can be used to read data from a file using a file descriptor?
1.os.reader()
2.os.read()
3.os.quick_read()
4.os.scan()
Posted Date:-2022-01-02 09:32:43
Which of the following functions does not accept any arguments?
1. position
2.fillcolor
3.goto
4. setheading()
Posted Date:-2022-01-02 09:38:37
Which of the following functions is not defined under the sys module?
1. sys.platform
2.sys.path
3. sys.readline
4.sys.argv
Posted Date:-2022-01-02 08:52:59
Which of the following functions returns a value in degrees, counterclockwise from the horizontal right?
1.heading()
2.degrees()
3.position()
4.window_height()
Posted Date:-2022-01-02 09:53:47
Which of the following is equivalent to random.randint(3, 6)?
1. random.choice([3, 6])
2.random.randrange(3, 6)
3. 3 + random.randrange(3)
4. 3 + random.randrange(4)
Posted Date:-2022-01-02 08:49:30
Which of the following is equivalent to random.randrange(3)?
1. range(3)
2.random.choice(range(0, 3))
3.random.shuffle(range(3))
4. random.select(range(3))
Posted Date:-2022-01-02 08:47:33
Which of the following returns a string that represents the present working directory?
1.os.getcwd()
2. os.cwd()
3. os.getpwd()
4.os.pwd()
Posted Date:-2022-01-02 09:33:06
Which of the following will never be displayed on executing print(random.choice({0: 1, 2: 3}))?
1.0
2. 1
3.KeyError: 1
4.none of the mentioned
Posted Date:-2022-01-02 08:50:25
Which of the following will not be returned by random.choice(“1 ,â€)?
1. 1
2. (space)
3. ,
4.none of the mentioned
Posted Date:-2022-01-02 08:49:56
Which type of elements are accepted by random.shuffle()?
1.strings
2.lists
3.tuples
4.integers
Posted Date:-2022-01-02 08:51:26